knitr::opts_chunk$set(echo = TRUE)

cmdstanr::set_cmdstan_path(path = "C:/Users/kueng/.cmdstan/cmdstan-2.35.0")


library(tidyverse)
library(R.utils)
library(wbCorr)
library(readxl)
library(kableExtra)
library(brms)
library(bayesplot)
library(beepr)
library(DHARMa)



source(file.path('Functions', 'ReportModels.R'))
source(file.path('Functions', 'PrettyTables.R'))
source(file.path('Functions', 'ReportMeasures.R'))
source(file.path('Functions', 'PrepareData.R'))
system("shutdown /a")
## [1] 1116
# Set options for analysis
use_mi = FALSE
shutdown = FALSE
report_ordinal = FALSE

options(
  dplyr.print_max = 100, 
  brms.backend = 'cmdstan',
  brms.file_refit = ifelse(use_mi, 'never', 'on_change'),
  brms.file_refit = 'on_change',
  #brms.file_refit = 'always',
  error = function() beepr::beep(sound = 5)
)


####################### Model parameters #######################

iterations = 5000
warmup = 2000

# NO AR!!!
#corstr = 'ar'
#corstr = 'cosy_couple'
#corstr = 'cosy_couple:user'


################################################################

suffix = as.character(iterations)
df <- openxlsx::read.xlsx(file.path('long.xlsx'))
df_original <- df

df_double <- prepare_data(df, recode_pushing = TRUE, use_mi = use_mi)[[1]]

Constructing scales Re-coding pusing reshaping data (4field) centering data within and between

Modelling

# For indistinguishable Dyads
model_rows_fixed <- c(
    'Intercept', 
    # '-- WITHIN PERSON MAIN EFFECTS --', 
    'persuasion_self_cw', 
    'persuasion_partner_cw', 
    'pressure_self_cw', 
    'pressure_partner_cw', 
    'pushing_self_cw', 
    'pushing_partner_cw', 
    'day', 
    'weartime_self_cw',
    
    # '-- BETWEEN PERSON MAIN EFFECTS',
    'persuasion_self_cb',
    'persuasion_partner_cb',
    'pressure_self_cb',
    'pressure_partner_cb',
    'pushing_self_cb',
    'pushing_partner_cb',
    'weartime_self_cb'
  )


model_rows_fixed_ordinal <- c(
  model_rows_fixed[1],
  'Intercept[1]',
  'Intercept[2]',
  'Intercept[3]',
  'Intercept[4]',
  'Intercept[5]',
  model_rows_fixed[2:length(model_rows_fixed)]
)

model_rows_random <- c(
  # '--------------',
  # '-- RANDOM EFFECTS --',
  'sd(Intercept)', 
  'sd(persuasion_self_cw)',
  'sd(persuasion_partner_cw)',
  'sd(pressure_self_cw)',
  'sd(pressure_partner_cw)',
  'sd(pushing_self_cw)',
  'sd(pushing_partner_cw)',
  # '-- CORRELATION STRUCTURE -- ', 
  'ar[1]', 
  'ma[1]', 
  'cosy',
  'nu',
  'shape',
  'sderr',
  'sigma'
)

model_rows_random_ordinal <- c(model_rows_random,'disc')
# For indistinguishable Dyads
model_rownames_fixed <- c(
    'Intercept', 
    # '-- WITHIN PERSON MAIN EFFECTS --', 
    'Daily received persuasion target -> target', 
    'Daily received persuasion target -> agent', 
    'Daily received pressure target -> target', 
    'Daily received pressure target -> agent', 
    'Daily received pushing target -> target', 
    'Daily received pushing target -> agent', 
    'Day', 
    'Daily weartime',
    
    # '-- BETWEEN PERSON MAIN EFFECTS',
    'Mean received persuasion target -> target',
    'Mean received persuasion target -> agent',
    'Mean received pressure target -> target',
    'Mean received pressure target -> agent',
    'Mean received pushing target -> target',
    'Mean received pushing target -> agent',
    'Mean weartime'
  )


model_rownames_fixed_ordinal <- c(
  model_rownames_fixed[1],
  'Intercept[1]',
  'Intercept[2]',
  'Intercept[3]',
  'Intercept[4]',
  'Intercept[5]',
  model_rownames_fixed[2:length(model_rownames_fixed)]
)

model_rownames_random <- c(
  # '--------------',
  # '-- RANDOM EFFECTS --',
  'sd(Intercept)', 
  'sd(Daily received persuasion target -> target)', 
  'sd(Daily received persuasion target -> agent)', 
  'sd(Daily received pressure target -> target)', 
  'sd(Daily received pressure target -> agent)', 
  'sd(Daily received pushing target -> target)', 
  'sd(Daily received pushing target -> agent)', 
  # '-- CORRELATION STRUCTURE -- ', 
  'ar[1]',
  'ma[1]', 
  'cosy',
  'nu',
  'shape',
  'sderr',
  'sigma'
)

model_rownames_random_ordinal <- c(model_rownames_random,'disc')
# For indistinguishable Dyads
model_rownames_fixed <- c(
    "Intercept", 
    # "-- WITHIN PERSON MAIN EFFECTS --", 
    "Daily persuasion experienced", 
    "Daily persuasion utilized (partner's view)", # OR partner received
    "Daily pressure experienced", 
    "Daily pressure utilized (partner's view)", 
    "Daily pushing experienced", 
    "Daily pushing utilized (partner's view)", 
    "Day", 
    "Daily weartime",
    
    # "-- BETWEEN PERSON MAIN EFFECTS",
    "Mean persuasion experienced", 
    "Mean persuasion utilized (partner's view)", 
    "Mean pressure experienced", 
    "Mean pressure utilized (partner's view)", 
    "Mean pushing experienced", 
    "Mean pushing utilized (partner's view)", 
    "Mean weartime"
  )


model_rownames_fixed_ordinal <- c(
  model_rownames_fixed[1],
  'Intercept[1]',
  'Intercept[2]',
  'Intercept[3]',
  'Intercept[4]',
  'Intercept[5]',
  model_rownames_fixed[2:length(model_rownames_fixed)]
)

model_rownames_random <- c(
  # '--------------',
  # '-- RANDOM EFFECTS --',
  'sd(Intercept)', 
  "sd(Daily persuasion experienced)", 
  "sd(Daily persuasion utilized (partner's view))", # OR partner received
  "sd(Daily pressure experienced)", 
  "sd(Daily pressure utilized (partner's view))", 
  "sd(Daily pushing experienced)", 
  "sd(Daily pushing utilized (partner's view))", 
  # '-- CORRELATION STRUCTURE -- ', 
  'ar[1]', 
  'ma[1]', 
  'cosy',
  'nu',
  'shape',
  'sderr',
  'sigma'
)

model_rownames_random_ordinal <- c(model_rownames_random,'disc')
rows_to_pack <- list(
  "Within-Person Effects" = c(2,9),
  "Between-Person Effects" = c(10,16),
  "Random Effects" = c(17, 23), 
  "Additional Parameters" = c(24,30)
  )


rows_to_pack_ordinal <- list(
  "Intercepts" = c(1,6),
  "Within-Person Effects" = c(2+5,9+5),
  "Between-Person Effects" = c(10+5,16+5),
  "Random Effects" = c(17+5, 23+5), 
  "Additional Parameters" = c(24+5,30+6)
  )

HURDLE MODELS

# For indistinguishable Dyads
model_rows_fixed_hu <- c(
    'Intercept', 
    'hu_Intercept',
    # '-- WITHIN PERSON MAIN EFFECTS --', 
    'persuasion_self_cw', 
    'persuasion_partner_cw', 
    'pressure_self_cw', 
    'pressure_partner_cw', 
    'pushing_self_cw', 
    'pushing_partner_cw', 
    'day', 
    'weartime_self_cw',
    
    # '-- BETWEEN PERSON MAIN EFFECTS',
    'persuasion_self_cb',
    'persuasion_partner_cb',
    'pressure_self_cb',
    'pressure_partner_cb',
    'pushing_self_cb',
    'pushing_partner_cb',
    'weartime_self_cb',
    
    # HURDLE MODEL
    # '-- WITHIN PERSON MAIN EFFECTS --', 
    'hu_persuasion_self_cw', 
    'hu_persuasion_partner_cw', 
    'hu_pressure_self_cw', 
    'hu_pressure_partner_cw', 
    'hu_pushing_self_cw', 
    'hu_pushing_partner_cw', 
    'hu_day', 
    'hu_weartime_self_cw',
    
    # '-- BETWEEN PERSON MAIN EFFECTS',
    'hu_persuasion_self_cb',
    'hu_persuasion_partner_cb',
    'hu_pressure_self_cb',
    'hu_pressure_partner_cb',
    'hu_pushing_self_cb',
    'hu_pushing_partner_cb',
    'hu_weartime_self_cb'
  )

model_rows_random_hu <- c(
  # '--------------',
  # '-- RANDOM EFFECTS --',
  'sd(Intercept)', 
  'sd(hu_Intercept)',
  'sd(persuasion_self_cw)',
  'sd(persuasion_partner_cw)',
  'sd(pressure_self_cw)',
  'sd(pressure_partner_cw)',
  'sd(pushing_self_cw)',
  'sd(pushing_partner_cw)',
  # HURDLE
  'sd(hu_persuasion_self_cw)',
  'sd(hu_persuasion_partner_cw)',
  'sd(hu_pressure_self_cw)',
  'sd(hu_pressure_partner_cw)',
  'sd(hu_pushing_self_cw)',
  'sd(hu_pushing_partner_cw)',
  # '-- CORRELATION STRUCTURE -- ', 
  'ar[1]', 
  'ma[1]', 
  'cosy',
  'nu',
  'shape',
  'sderr',
  'sigma'
)
# For indistinguishable Dyads
model_rownames_fixed_hu <- c(
    "Intercept", 
    "Hurdle Intercept",
    # "-- WITHIN PERSON MAIN EFFECTS --", 
    "Daily persuasion experienced", 
    "Daily persuasion utilized (partner's view)", # OR partner received
    "Daily pressure experienced", 
    "Daily pressure utilized (partner's view)", 
    "Daily pushing experienced", 
    "Daily pushing utilized (partner's view)", 
    "Day", 
    "Daily weartime",
    
    # "-- BETWEEN PERSON MAIN EFFECTS",
    "Mean persuasion experienced", 
    "Mean persuasion utilized (partner's view)", 
    "Mean pressure experienced", 
    "Mean pressure utilized (partner's view)", 
    "Mean pushing experienced", 
    "Mean pushing utilized (partner's view)", 
    "Mean weartime",
    
    # HURDLE
    # "-- WITHIN PERSON MAIN EFFECTS --", 
    "Hu Daily persuasion experienced", 
    "Hu Daily persuasion utilized (partner's view)", # OR partner received
    "Hu Daily pressure experienced", 
    "Hu Daily pressure utilized (partner's view)", 
    "Hu Daily pushing experienced", 
    "Hu Daily pushing utilized (partner's view)", 
    "Hu Day", 
    "Hu Daily weartime",
    
    # "-- BETWEEN PERSON MAIN EFFECTS",
    "Hu Mean persuasion experienced", 
    "Hu Mean persuasion utilized (partner's view)", 
    "Hu Mean pressure experienced", 
    "Hu Mean pressure utilized (partner's view)", 
    "Hu Mean pushing experienced", 
    "Hu Mean pushing utilized (partner's view)", 
    "Hu Mean weartime"
  )


model_rownames_random_hu <- c(
  # '--------------',
  # '-- RANDOM EFFECTS --',
  'sd(Intercept)', 
  'sd(Hurdle Intercept)', 
  "sd(Daily persuasion experienced)", 
  "sd(Daily persuasion utilized (partner's view))", # OR partner received
  "sd(Daily pressure experienced)", 
  "sd(Daily pressure utilized (partner's view))", 
  "sd(Daily pushing experienced)", 
  "sd(Daily pushing utilized (partner's view))", 
  
  # Hurdle
  "sd(Hu Daily persuasion experienced)", 
  "sd(Hu Daily persuasion utilized (partner's view))", # OR partner received
  "sd(Hu Daily pressure experienced)", 
  "sd(Hu Daily pressure utilized (partner's view))", 
  "sd(Hu Daily pushing experienced)", 
  "sd(Hu Daily pushing utilized (partner's view))", 
  # '-- CORRELATION STRUCTURE -- ', 
  'ar[1]', 
  'ma[1]', 
  'cosy',
  'nu',
  'shape',
  'sderr',
  'sigma'
)
rows_to_pack_hu <- list(
  "Conditional Within-Person Effects" = c(3,10),
  "Conditional Between-Person Effects" = c(11,17),
  
  "Hurdle Within-Person Effects" = c(18,25),
  "Hurdle Between-Person Effects" = c(26,32),
  
  "Random Effects" = c(33, 46), 
  "Additional Parameters" = c(47,53)
  )

Subjective MVPA

range(df_double$pa_sub, na.rm = T) 
## [1]   0 720
hist(df_double$pa_sub, breaks = 40) 

hist(log(df_double$pa_sub+00000000001), breaks = 40)

Hurdle Poisson Model

formula <- bf(
  pa_sub ~ 
    persuasion_self_cw + persuasion_partner_cw +
    pressure_self_cw + pressure_partner_cw +
    pushing_self_cw + pushing_partner_cw +
    
    persuasion_self_cb + persuasion_partner_cb +
    pressure_self_cb + pressure_partner_cb +
    pushing_self_cb + pushing_partner_cb +
    
    day + 
    
    # Random effects
    (1 + persuasion_self_cw + persuasion_partner_cw +
    pressure_self_cw + pressure_partner_cw +
    pushing_self_cw + pushing_partner_cw | coupleID),
  
  hu = ~ persuasion_self_cw + persuasion_partner_cw +
    pressure_self_cw + pressure_partner_cw +
    pushing_self_cw + pushing_partner_cw +
    
    persuasion_self_cb + persuasion_partner_cb +
    pressure_self_cb + pressure_partner_cb +
    pushing_self_cb + pushing_partner_cb +
    
    day + 
    
    # Random effects
    (1 + persuasion_self_cw + persuasion_partner_cw +
    pressure_self_cw + pressure_partner_cw +
    pushing_self_cw + pushing_partner_cw | coupleID)
  #, autocor = autocor_str
) 

prior1 <- c(
  brms::set_prior("normal(0, 2.5)", class = "b")
  , brms::set_prior("normal(0, 50)", class = "Intercept") # for non-zero PA
  , brms::set_prior("normal(6, 2.5)", class = "Intercept", dpar = 'hu') # hurdle part
  
  , brms::set_prior("normal(0, 2)", class = "sd", group = "coupleID", lb = 0)
  
  #, brms::set_prior("normal(10, 10", class = "shape")
  
  #, brms::set_prior("cauchy(0, 2)", class = "sigma", lb = 0)
  #, brms::set_prior("cauchy(0, 2)", class = "sderr", lb = 0)
  
  #, autocor_prior
)

brms::validate_prior(
  prior1, 
  formula = formula, 
  data = df_double, 
  family = hurdle_poisson()
  )
## Warning: Rows containing NAs were excluded from the model.
#df_minimal <- df_double[, c("AorB", all.vars(as.formula(formula)))]

pa_sub <- my_brm(
  mi = use_mi, 
  imputed_data = implist,
  
  formula = formula, 
  prior = prior1,
  data = df_double, 
  #family = brms::hurdle_lognormal(), 
  #family = brms::hurdle_negbinomial(), 
  family = brms::hurdle_poisson(),
  control = list(adapt_delta = 0.95, max_treedepth = 15),
  iter = iterations,
  warmup = warmup,
  chains = 4,
  cores = 4,
  seed = 7777,
  file = file.path("models_cache_brms", paste0("pa_sub_hu_poisson_NOAR", suffix))
  #, file_refit = 'always'
)
## Warning: Rows containing NAs were excluded from the model.
check_brms(pa_sub, log_pp_check = TRUE)
## 
## Divergences:
## 0 of 12000 iterations ended with a divergence.
## 
## Tree depth:
## 12000 of 12000 iterations saturated the maximum tree depth of 10 (100%).
## Try increasing 'max_treedepth' to avoid saturation.
## 
## Energy:
## E-BFMI indicated no pathological behavior.

## Using 10 posterior draws for ppc type 'ecdf_overlay' by default.

## Using 10 posterior draws for ppc type 'dens_overlay' by default.

## Warning: Found 324 observations with a pareto_k > 0.7 in model 'model'. We
## recommend to set 'moment_match = TRUE' in order to perform moment matching for
## problematic observations.
## 
## Computed from 12000 by 3736 log-likelihood matrix.
## 
##          Estimate     SE
## elpd_loo -32926.5 1736.5
## p_loo      4436.0  309.4
## looic     65853.0 3473.1
## ------
## MCSE of elpd_loo is NA.
## MCSE and ESS estimates assume MCMC draws (r_eff in [0.5, 2.2]).
## 
## Pareto k diagnostic values:
##                          Count Pct.    Min. ESS
## (-Inf, 0.7]   (good)     3412  91.3%   108     
##    (0.7, 1]   (bad)       152   4.1%   <NA>    
##    (1, Inf)   (very bad)  172   4.6%   <NA>    
## See help('pareto-k-diagnostic') for details.
DHARMa.check_brms.all(pa_sub, integer = TRUE, outliers_type = 'bootstrap')
## DHARMa:testOutliers with type = binomial may have inflated Type I error rates for integer-valued distributions. To get a more exact result, it is recommended to re-run testOutliers with type = 'bootstrap'. See ?testOutliers for details

## 
##  DHARMa bootstrapped outlier test
## 
## data:  model.check
## outliers at both margin(s) = 297, observations = 3736, p-value <
## 2.2e-16
## alternative hypothesis: two.sided
##  percent confidence interval:
##  0.000267666 0.002676660
## sample estimates:
## outlier frequency (expected: 0.00133565310492505 ) 
##                                         0.07949679
#shinystan::launch_shinystan(pa_sub)

In this instance, the warning about max treedepth is a false positive. We have set treedepth to 15, and when we check with shinystan, we see that treedepth is continuously between 10 and 14.

summarize_brms(
  pa_sub, 
  model_rows_fixed = model_rows_fixed_hu,
  model_rows_random = model_rows_random_hu,
  model_rownames_fixed = model_rownames_fixed_hu,
  model_rownames_random = model_rownames_random_hu,
  exponentiate = T,
  include_p_direction = T) %>%
  print_df(rows_to_pack = rows_to_pack_hu
)
## Warning in summarize_brms(pa_sub, model_rows_fixed = model_rows_fixed_hu, :
## Coefficients were exponentiated. Double check if this was intended.
exp(Est.) l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS p_direction
Intercept 62.20* 55.66 69.71 1.004 989.97 2294.67 1
Hurdle Intercept 1.20 0.86 1.66 1.001 2256.57 4110.71 0.867
Conditional Within-Person Effects
Daily persuasion experienced 0.98 0.90 1.07 1.006 795.76 1822.95 0.683
Daily persuasion utilized (partner’s view) 1.03 0.97 1.11 1.004 1056.94 2116.00 0.847
Daily pressure experienced 7.90 0.86 70.81 1.003 1338.21 2824.01 0.965
Daily pressure utilized (partner’s view) 0.87 0.71 1.06 1.001 2127.29 4105.78 0.919
Daily pushing experienced 1.05 0.87 1.26 1.003 1740.67 3882.75 0.69
Daily pushing utilized (partner’s view) 0.94 0.84 1.04 1.001 2044.12 3894.77 0.875
Day 0.92* 0.90 0.95 1.001 17314.47 9234.40 1
Daily weartime NA NA NA NA NA NA NA
Conditional Between-Person Effects
Mean persuasion experienced 1.25 0.94 1.67 1.002 1073.61 1682.92 0.937
Mean persuasion utilized (partner’s view) 1.01 0.75 1.34 1.002 1086.50 1649.44 0.524
Mean pressure experienced 1.04 0.78 1.40 1.003 1296.15 2279.71 0.615
Mean pressure utilized (partner’s view) 0.75 0.56 1.00 1.002 1279.47 2095.26 0.973
Mean pushing experienced 1.13 0.75 1.72 1.005 1308.96 2459.68 0.73
Mean pushing utilized (partner’s view) 1.20 0.79 1.81 1.004 1311.24 2521.06 0.808
Mean weartime NA NA NA NA NA NA NA
Hurdle Within-Person Effects
Hu Daily persuasion experienced 0.65* 0.57 0.73 1.000 7364.65 7946.25 1
Hu Daily persuasion utilized (partner’s view) 0.75* 0.67 0.84 1.000 8422.90 7976.02 1
Hu Daily pressure experienced 1.23 0.88 1.74 1.001 9574.39 8173.37 0.9
Hu Daily pressure utilized (partner’s view) 0.66* 0.42 0.95 1.001 8350.07 5838.91 0.988
Hu Daily pushing experienced 0.58* 0.40 0.79 1.000 6907.32 7439.26 1
Hu Daily pushing utilized (partner’s view) 0.54* 0.41 0.68 1.000 8511.25 7963.77 1
Hu Day 1.09 0.84 1.42 1.000 17531.53 9304.50 0.748
Hu Daily weartime NA NA NA NA NA NA NA
Hurdle Between-Person Effects
Hu Mean persuasion experienced 0.83 0.36 1.94 1.003 2123.50 3132.49 0.682
Hu Mean persuasion utilized (partner’s view) 0.83 0.36 1.95 1.003 2008.35 3514.02 0.669
Hu Mean pressure experienced 3.48* 1.39 8.81 1.001 3107.54 5851.89 0.996
Hu Mean pressure utilized (partner’s view) 1.83 0.74 4.54 1.001 2989.11 5919.83 0.904
Hu Mean pushing experienced 0.32 0.10 1.05 1.003 3041.55 4902.54 0.97
Hu Mean pushing utilized (partner’s view) 0.31 0.09 1.03 1.003 2942.79 5162.04 0.972
Hu Mean weartime NA NA NA NA NA NA NA
Random Effects
sd(Intercept) 0.35 0.27 0.45 1.00 2074.48 4058.90 NA
sd(Hurdle Intercept) 0.90 0.69 1.18 1.00 3189.15 6010.29 NA
sd(Daily persuasion experienced) 0.25 0.20 0.32 1.00 2474.51 4747.59 NA
sd(Daily persuasion utilized (partner’s view)) 0.19 0.15 0.25 1.00 2696.26 4675.30 NA
sd(Daily pressure experienced) 6.39 5.07 8.02 1.00 4024.22 6575.50 NA
sd(Daily pressure utilized (partner’s view)) 0.49 0.34 0.71 1.00 3924.64 6606.95 NA
sd(Daily pushing experienced) 0.52 0.33 0.76 1.00 2398.31 4908.16 NA
sd(Daily pushing utilized (partner’s view)) 0.31 0.23 0.40 1.00 3943.98 5332.85 NA
sd(Hu Daily persuasion experienced) 0.18 0.03 0.34 1.00 3644.04 2786.42 NA
sd(Hu Daily persuasion utilized (partner’s view)) 0.17 0.02 0.33 1.00 3172.95 2748.67 NA
sd(Hu Daily pressure experienced) 0.30 0.01 0.85 1.00 4046.35 5396.49 NA
sd(Hu Daily pressure utilized (partner’s view)) 0.35 0.01 1.03 1.00 3835.17 5286.84 NA
sd(Hu Daily pushing experienced) 0.65 0.33 1.10 1.00 4979.18 6891.91 NA
sd(Hu Daily pushing utilized (partner’s view)) 0.32 0.05 0.64 1.00 4791.15 3731.36 NA
Additional Parameters
ar[1] NA NA NA NA NA NA NA
ma[1] NA NA NA NA NA NA NA
cosy NA NA NA NA NA NA NA
nu NA NA NA NA NA NA NA
shape NA NA NA NA NA NA NA
sderr NA NA NA NA NA NA NA
sigma NA NA NA NA NA NA NA

Additionally, as a sensitivity analysis, we estimate the two part of the models separately.

Two separate models

Modelling 0/1

The zero vs. 1 modelling part also has high pareto-k values, but reaches the same conslucsions as the hurdle model. We tried further simplifying by removing the residual AR1 correlation structure, which led to a model with good pareto-k values, still arriving at the same conslusion as the original hurdle model:

df_double$pa_sub_zero <- as.factor(ifelse(df_double$pa_sub > 0, 1, 0))

formula <- bf(
  pa_sub_zero ~ 
    persuasion_self_cw + persuasion_partner_cw +
    pressure_self_cw + pressure_partner_cw +
    pushing_self_cw + pushing_partner_cw +
    
    persuasion_self_cb + persuasion_partner_cb +
    pressure_self_cb + pressure_partner_cb +
    pushing_self_cb + pushing_partner_cb +
    
    day + 
    
    # Random effects
    (1 + persuasion_self_cw + persuasion_partner_cw +
    pressure_self_cw + pressure_partner_cw +
    pushing_self_cw + pushing_partner_cw | coupleID)
  #, autocor = autocor_str
) 

prior1 <- c(
    set_prior("normal(0, 1.5)", class = "b")
  , brms::set_prior("normal(0, 5)", class = "Intercept") # for non-zero PA

  , brms::set_prior("normal(0, 1)", class = "sd", group = "coupleID")

  #, brms::set_prior("cauchy(0, 2)", class = "sigma", lb = 0)
  #, brms::set_prior("cauchy(0, 1.5)", class = "sderr", lb = 0)
  
  #, autocor_prior
)

brms::validate_prior(
  prior1, 
  formula = formula, 
  data = df_double, 
  family = bernoulli()
  )
## Warning: Rows containing NAs were excluded from the model.
pa_sub_zero_model <- my_brm(
  mi = use_mi, 
  imputed_data = implist,
  
  formula = formula, 
  prior = prior1,
  data = df_double, 
  #family = brms::hurdle_lognormal(), 
  #family = brms::hurdle_negbinomial(), 
  family = brms::bernoulli(),
  #control = list(adapt_delta = 0.95),
  iter = iterations,
  warmup = warmup,
  chains = 4,
  cores = 4,
  seed = 7777,
  file = file.path("models_cache_brms", paste0("pa_sub_hu_zero_part_NOAR", suffix))
)
## Warning: Rows containing NAs were excluded from the model.
check_brms(pa_sub_zero_model, log_pp_check = FALSE)
## 
## Divergences:
## 0 of 12000 iterations ended with a divergence.
## 
## Tree depth:
## 0 of 12000 iterations saturated the maximum tree depth of 10.
## 
## Energy:
## E-BFMI indicated no pathological behavior.

## Using 10 posterior draws for ppc type 'ecdf_overlay' by default.

## Using 10 posterior draws for ppc type 'dens_overlay' by default.

## Warning: Found 2 observations with a pareto_k > 0.7 in model 'model'. We
## recommend to set 'moment_match = TRUE' in order to perform moment matching for
## problematic observations.
## 
## Computed from 12000 by 3736 log-likelihood matrix.
## 
##          Estimate   SE
## elpd_loo  -2149.7 27.8
## p_loo        93.4  4.1
## looic      4299.5 55.6
## ------
## MCSE of elpd_loo is NA.
## MCSE and ESS estimates assume MCMC draws (r_eff in [0.5, 2.3]).
## 
## Pareto k diagnostic values:
##                          Count Pct.    Min. ESS
## (-Inf, 0.7]   (good)     3734  99.9%   355     
##    (0.7, 1]   (bad)         2   0.1%   <NA>    
##    (1, Inf)   (very bad)    0   0.0%   <NA>    
## See help('pareto-k-diagnostic') for details.
DHARMa.check_brms.all(pa_sub_zero_model, integer = TRUE, outliers_type = 'bootstrap')

## 
##  DHARMa bootstrapped outlier test
## 
## data:  model.check
## outliers at both margin(s) = 0, observations = 3736, p-value = 1
## alternative hypothesis: two.sided
##  percent confidence interval:
##  0 0
## sample estimates:
## outlier frequency (expected: 0 ) 
##                                0
summarize_brms(
  pa_sub_zero_model, 
  model_rows_fixed = model_rows_fixed_hu,
  model_rows_random = model_rows_random_hu,
  model_rownames_fixed = model_rownames_fixed_hu,
  model_rownames_random = model_rownames_random_hu,
  exponentiate = T,
  include_p_direction = T) %>%
  print_df(rows_to_pack = rows_to_pack_hu
)
OR l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS p_direction
Intercept 0.84 0.61 1.15 1.001 1841.97 3973.90 0.863
Hurdle Intercept NA NA NA NA NA NA NA
Conditional Within-Person Effects
Daily persuasion experienced 1.53* 1.36 1.75 1.001 8062.00 8582.55 1
Daily persuasion utilized (partner’s view) 1.33* 1.19 1.50 1.000 9007.75 8833.49 1
Daily pressure experienced 0.82 0.59 1.11 1.000 10666.20 8323.82 0.906
Daily pressure utilized (partner’s view) 1.48* 1.05 2.25 1.000 10016.51 6740.30 0.987
Daily pushing experienced 1.72* 1.28 2.43 1.000 7256.09 7373.66 1
Daily pushing utilized (partner’s view) 1.83* 1.46 2.40 1.001 8929.39 8028.12 1
Day 0.92 0.71 1.19 1.000 18939.10 8954.86 0.739
Daily weartime NA NA NA NA NA NA NA
Conditional Between-Person Effects
Mean persuasion experienced 1.17 0.56 2.48 1.002 1891.71 4153.21 0.667
Mean persuasion utilized (partner’s view) 1.17 0.57 2.44 1.002 1970.51 4133.98 0.666
Mean pressure experienced 0.33* 0.15 0.75 1.001 2989.43 5922.42 0.996
Mean pressure utilized (partner’s view) 0.59 0.26 1.34 1.002 3409.72 5951.96 0.9
Mean pushing experienced 2.45 0.84 7.10 1.001 3185.19 5355.11 0.953
Mean pushing utilized (partner’s view) 2.56 0.88 7.30 1.001 3160.95 5396.08 0.958
Mean weartime NA NA NA NA NA NA NA
Hurdle Within-Person Effects
Hu Daily persuasion experienced NA NA NA NA NA NA NA
Hu Daily persuasion utilized (partner’s view) NA NA NA NA NA NA NA
Hu Daily pressure experienced NA NA NA NA NA NA NA
Hu Daily pressure utilized (partner’s view) NA NA NA NA NA NA NA
Hu Daily pushing experienced NA NA NA NA NA NA NA
Hu Daily pushing utilized (partner’s view) NA NA NA NA NA NA NA
Hu Day NA NA NA NA NA NA NA
Hu Daily weartime NA NA NA NA NA NA NA
Hurdle Between-Person Effects
Hu Mean persuasion experienced NA NA NA NA NA NA NA
Hu Mean persuasion utilized (partner’s view) NA NA NA NA NA NA NA
Hu Mean pressure experienced NA NA NA NA NA NA NA
Hu Mean pressure utilized (partner’s view) NA NA NA NA NA NA NA
Hu Mean pushing experienced NA NA NA NA NA NA NA
Hu Mean pushing utilized (partner’s view) NA NA NA NA NA NA NA
Hu Mean weartime NA NA NA NA NA NA NA
Random Effects
sd(Intercept) 0.89 0.68 1.14 1.00 3199.26 5243.78 NA
sd(Hurdle Intercept) NA NA NA NA NA NA NA
sd(Daily persuasion experienced) 0.18 0.02 0.34 1.00 3164.76 2298.66 NA
sd(Daily persuasion utilized (partner’s view)) 0.17 0.02 0.33 1.00 3506.22 3289.23 NA
sd(Daily pressure experienced) 0.28 0.01 0.78 1.00 4188.59 5081.55 NA
sd(Daily pressure utilized (partner’s view)) 0.31 0.01 0.90 1.00 3962.03 5276.36 NA
sd(Daily pushing experienced) 0.62 0.32 1.01 1.00 5746.41 6689.15 NA
sd(Daily pushing utilized (partner’s view)) 0.31 0.05 0.63 1.00 4373.04 3371.61 NA
sd(Hu Daily persuasion experienced) NA NA NA NA NA NA NA
sd(Hu Daily persuasion utilized (partner’s view)) NA NA NA NA NA NA NA
sd(Hu Daily pressure experienced) NA NA NA NA NA NA NA
sd(Hu Daily pressure utilized (partner’s view)) NA NA NA NA NA NA NA
sd(Hu Daily pushing experienced) NA NA NA NA NA NA NA
sd(Hu Daily pushing utilized (partner’s view)) NA NA NA NA NA NA NA
Additional Parameters
ar[1] NA NA NA NA NA NA NA
ma[1] NA NA NA NA NA NA NA
cosy NA NA NA NA NA NA NA
nu NA NA NA NA NA NA NA
shape NA NA NA NA NA NA NA
sderr NA NA NA NA NA NA NA
sigma NA NA NA NA NA NA NA

Modelling active Days

# Only include active days
df_double$pa_sub_non_zero <- ifelse(df_double$pa_sub > 0, df_double$pa_sub, NA)

formula <- bf(
  log(pa_sub_non_zero) ~ 
    persuasion_self_cw + persuasion_partner_cw +
    pressure_self_cw + pressure_partner_cw +
    pushing_self_cw + pushing_partner_cw +
    
    persuasion_self_cb + persuasion_partner_cb +
    pressure_self_cb + pressure_partner_cb +
    pushing_self_cb + pushing_partner_cb +
    
    day + 
    
    # Random effects
    (1 + persuasion_self_cw + persuasion_partner_cw +
    pressure_self_cw + pressure_partner_cw +
    pushing_self_cw + pushing_partner_cw | coupleID)
  ##, autocor = autocor_str
) 

prior1 <- c(
  brms::set_prior("normal(0, 2.5)", class = "b")
  , brms::set_prior("normal(0, 50)", class = "Intercept") # for non-zero PA

  , brms::set_prior("normal(0, 2)", class = "sd", group = "coupleID", lb = 0)
  
  , brms::set_prior("cauchy(0, 2)", class = "sigma", lb = 0)
  #, brms::set_prior("cauchy(0, 2)", class = "sderr", lb = 0)
  
  #, autocor_prior
)

brms::validate_prior(
  prior1, 
  formula = formula, 
  data = df_double, 
  family = gaussian()
  )
## Warning: Rows containing NAs were excluded from the model.
pa_sub_active_model <- my_brm(
  mi = use_mi, 
  imputed_data = implist,
  
  formula = formula, 
  prior = prior1,
  data = df_double, 
  family = gaussian(),
  #control = list(adapt_delta = 0.95),
  iter = iterations,
  warmup = warmup,
  chains = 4,
  cores = 4,
  seed = 7777,
  file = file.path("models_cache_brms", paste0("pa_sub_hu_active_part_NOAR", suffix))
)
## Warning: Rows containing NAs were excluded from the model.
check_brms(pa_sub_active_model, log_pp_check = TRUE)
## 
## Divergences:
## 0 of 12000 iterations ended with a divergence.
## 
## Tree depth:
## 0 of 12000 iterations saturated the maximum tree depth of 10.
## 
## Energy:
## E-BFMI indicated no pathological behavior.

## Using 10 posterior draws for ppc type 'ecdf_overlay' by default.

## Using 10 posterior draws for ppc type 'dens_overlay' by default.

## 
## Computed from 12000 by 1672 log-likelihood matrix.
## 
##          Estimate   SE
## elpd_loo  -1785.5 35.3
## p_loo        85.9  4.1
## looic      3571.1 70.6
## ------
## MCSE of elpd_loo is 0.1.
## MCSE and ESS estimates assume MCMC draws (r_eff in [0.5, 2.0]).
## 
## All Pareto k estimates are good (k < 0.7).
## See help('pareto-k-diagnostic') for details.
DHARMa.check_brms.all(pa_sub_active_model, integer = TRUE, outliers_type = 'bootstrap')
## DHARMa:testOutliers with type = binomial may have inflated Type I error rates for integer-valued distributions. To get a more exact result, it is recommended to re-run testOutliers with type = 'bootstrap'. See ?testOutliers for details

## 
##  DHARMa bootstrapped outlier test
## 
## data:  model.check
## outliers at both margin(s) = 8, observations = 1672, p-value = 0.36
## alternative hypothesis: two.sided
##  percent confidence interval:
##  0.000882177 0.005980861
## sample estimates:
## outlier frequency (expected: 0.0033133971291866 ) 
##                                       0.004784689
summarize_brms(
  pa_sub_active_model, 
  model_rows_fixed = model_rows_fixed_hu,
  model_rows_random = model_rows_random_hu,
  model_rownames_fixed = model_rownames_fixed_hu,
  model_rownames_random = model_rownames_random_hu,
  exponentiate = T,
  include_p_direction = T) %>%
  print_df(rows_to_pack = rows_to_pack_hu
)
## Warning in summarize_brms(pa_sub_active_model, model_rows_fixed =
## model_rows_fixed_hu, : Coefficients were exponentiated. Double check if this
## was intended.
exp(Est.) l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS p_direction
Intercept 47.85* 42.22 54.17 1.001 4041.60 6381.47 1
Hurdle Intercept NA NA NA NA NA NA NA
Conditional Within-Person Effects
Daily persuasion experienced 1.03 0.97 1.08 1.000 6597.52 8346.37 0.833
Daily persuasion utilized (partner’s view) 1.03 0.99 1.08 1.000 8955.61 9602.22 0.904
Daily pressure experienced 0.89* 0.80 0.99 1.000 14496.32 8806.27 0.987
Daily pressure utilized (partner’s view) 0.94 0.85 1.03 1.000 13817.24 8187.83 0.908
Daily pushing experienced 1.03 0.96 1.10 1.000 11709.14 9409.07 0.775
Daily pushing utilized (partner’s view) 0.99 0.93 1.05 1.000 11995.74 10105.19 0.633
Day 1.01 0.89 1.14 1.000 20035.93 9281.40 0.545
Daily weartime NA NA NA NA NA NA NA
Conditional Between-Person Effects
Mean persuasion experienced 1.00 0.73 1.37 1.001 3231.81 4989.35 0.51
Mean persuasion utilized (partner’s view) 0.98 0.72 1.33 1.001 3286.72 5489.83 0.56
Mean pressure experienced 1.15 0.80 1.64 1.000 5002.27 7220.72 0.778
Mean pressure utilized (partner’s view) 0.89 0.61 1.28 1.000 5018.40 7058.04 0.732
Mean pushing experienced 1.34 0.84 2.11 1.000 4624.61 7355.15 0.896
Mean pushing utilized (partner’s view) 1.42 0.89 2.26 1.000 4706.03 7431.81 0.929
Mean weartime NA NA NA NA NA NA NA
Hurdle Within-Person Effects
Hu Daily persuasion experienced NA NA NA NA NA NA NA
Hu Daily persuasion utilized (partner’s view) NA NA NA NA NA NA NA
Hu Daily pressure experienced NA NA NA NA NA NA NA
Hu Daily pressure utilized (partner’s view) NA NA NA NA NA NA NA
Hu Daily pushing experienced NA NA NA NA NA NA NA
Hu Daily pushing utilized (partner’s view) NA NA NA NA NA NA NA
Hu Day NA NA NA NA NA NA NA
Hu Daily weartime NA NA NA NA NA NA NA
Hurdle Between-Person Effects
Hu Mean persuasion experienced NA NA NA NA NA NA NA
Hu Mean persuasion utilized (partner’s view) NA NA NA NA NA NA NA
Hu Mean pressure experienced NA NA NA NA NA NA NA
Hu Mean pressure utilized (partner’s view) NA NA NA NA NA NA NA
Hu Mean pushing experienced NA NA NA NA NA NA NA
Hu Mean pushing utilized (partner’s view) NA NA NA NA NA NA NA
Hu Mean weartime NA NA NA NA NA NA NA
Random Effects
sd(Intercept) 0.32 0.25 0.42 1.00 3621.92 6455.57 NA
sd(Hurdle Intercept) NA NA NA NA NA NA NA
sd(Daily persuasion experienced) 0.12 0.08 0.17 1.00 7194.08 9303.03 NA
sd(Daily persuasion utilized (partner’s view)) 0.09 0.05 0.13 1.00 8556.16 8646.99 NA
sd(Daily pressure experienced) 0.08 0.00 0.23 1.00 5748.83 6157.17 NA
sd(Daily pressure utilized (partner’s view)) 0.07 0.00 0.19 1.00 6534.51 6674.27 NA
sd(Daily pushing experienced) 0.11 0.04 0.19 1.00 5752.73 4564.11 NA
sd(Daily pushing utilized (partner’s view)) 0.09 0.02 0.17 1.00 5084.36 3390.77 NA
sd(Hu Daily persuasion experienced) NA NA NA NA NA NA NA
sd(Hu Daily persuasion utilized (partner’s view)) NA NA NA NA NA NA NA
sd(Hu Daily pressure experienced) NA NA NA NA NA NA NA
sd(Hu Daily pressure utilized (partner’s view)) NA NA NA NA NA NA NA
sd(Hu Daily pushing experienced) NA NA NA NA NA NA NA
sd(Hu Daily pushing utilized (partner’s view)) NA NA NA NA NA NA NA
Additional Parameters
ar[1] NA NA NA NA NA NA NA
ma[1] NA NA NA NA NA NA NA
cosy NA NA NA NA NA NA NA
nu NA NA NA NA NA NA NA
shape NA NA NA NA NA NA NA
sderr NA NA NA NA NA NA NA
sigma 0.68 0.66 0.71 1.00 19220.03 8549.91 NA

Device Based MVPA

range(df_double$pa_obj, na.rm = T) 
## [1]   5.75 971.25
hist(df_double$pa_obj, breaks = 50)

df_double$pa_obj_log <- log(df_double$pa_obj)

hist(df_double$pa_obj_log, breaks = 50)

log gaussian

formula <- bf(
  log(pa_obj) ~ 
    persuasion_self_cw + persuasion_partner_cw +
    pressure_self_cw + pressure_partner_cw +
    pushing_self_cw + pushing_partner_cw +
    
    persuasion_self_cb + persuasion_partner_cb +
    pressure_self_cb + pressure_partner_cb +
    pushing_self_cb + pushing_partner_cb +
    
    day + weartime_self_cw + weartime_self_cb +
    
    # Random effects
    (persuasion_self_cw + persuasion_partner_cw +
    pressure_self_cw + pressure_partner_cw +
    pushing_self_cw + pushing_partner_cw | coupleID)
  #, autocor = autocor_str
)



prior1 <- c(
  brms::set_prior("normal(0, 2.5)", class = "b")
  , brms::set_prior("normal(0, 50)", class = "Intercept") # for non-zero PA

  , brms::set_prior("normal(0, 2)", class = "sd", group = "coupleID", lb = 0)
  
  , brms::set_prior("cauchy(0, 2)", class = "sigma", lb = 0)
  #, brms::set_prior("cauchy(0, 2)", class = "sderr", lb = 0)
  
  #, autocor_prior
)

brms::validate_prior(
  prior1, 
  formula = formula, 
  data = df_double, 
  family = gaussian()
  )
## Warning: Rows containing NAs were excluded from the model.
#df_minimal <- df_double[, c("AorB", all.vars(as.formula(formula)))]

pa_obj_log <- my_brm(
  mi = use_mi, 
  imputed_data = implist,
  
  formula = formula, 
  prior = prior1,
  data = df_double, 
  family = gaussian(),
  #control = list(adapt_delta = 0.95),
  iter = iterations,
  warmup = warmup,
  chains = 4,
  cores = 4,
  seed = 7777,
  file = file.path("models_cache_brms", paste0("pa_obj_log_gaussian_NOAR", suffix))
)
## Warning: Rows containing NAs were excluded from the model.
check_brms(pa_obj_log, log_pp_check = TRUE)
## 
## Divergences:
## 0 of 12000 iterations ended with a divergence.
## 
## Tree depth:
## 0 of 12000 iterations saturated the maximum tree depth of 10.
## 
## Energy:
## E-BFMI indicated no pathological behavior.

## Using 10 posterior draws for ppc type 'ecdf_overlay' by default.

## Using 10 posterior draws for ppc type 'dens_overlay' by default.

## 
## Computed from 12000 by 3337 log-likelihood matrix.
## 
##          Estimate    SE
## elpd_loo  -2936.5  56.3
## p_loo        92.1   4.5
## looic      5872.9 112.6
## ------
## MCSE of elpd_loo is 0.1.
## MCSE and ESS estimates assume MCMC draws (r_eff in [0.4, 2.3]).
## 
## All Pareto k estimates are good (k < 0.7).
## See help('pareto-k-diagnostic') for details.
DHARMa.check_brms.all(pa_obj_log, integer = TRUE, outliers_type = 'bootstrap')
## DHARMa:testOutliers with type = binomial may have inflated Type I error rates for integer-valued distributions. To get a more exact result, it is recommended to re-run testOutliers with type = 'bootstrap'. See ?testOutliers for details

## 
##  DHARMa bootstrapped outlier test
## 
## data:  model.check
## outliers at both margin(s) = 26, observations = 3337, p-value < 2.2e-16
## alternative hypothesis: two.sided
##  percent confidence interval:
##  0.001498352 0.004652382
## sample estimates:
## outlier frequency (expected: 0.00298172010788133 ) 
##                                        0.007791429
summarize_brms(
  pa_obj_log, 
  model_rows_fixed = model_rows_fixed,
  model_rows_random = model_rows_random,
  model_rownames_fixed = model_rownames_fixed,
  model_rownames_random = model_rownames_random,
  exponentiate = T,
  include_p_direction = T) %>%
  print_df(rows_to_pack = rows_to_pack)
## Warning in summarize_brms(pa_obj_log, model_rows_fixed = model_rows_fixed, :
## Coefficients were exponentiated. Double check if this was intended.
exp(Est.) l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS p_direction
Intercept 117.41* 105.48 130.41 1.002 1936.20 4337.49 1
Within-Person Effects
Daily persuasion experienced 1.03 1.00 1.06 1.000 8443.32 9440.38 0.966
Daily persuasion utilized (partner’s view) 1.02 0.99 1.05 1.001 10110.26 9523.00 0.888
Daily pressure experienced 0.94 0.88 1.01 1.000 13123.29 8882.26 0.96
Daily pressure utilized (partner’s view) 0.98 0.92 1.05 1.000 14150.05 9457.65 0.714
Daily pushing experienced 1.03 0.98 1.08 1.000 11136.01 8673.71 0.9
Daily pushing utilized (partner’s view) 1.02 0.97 1.06 1.000 15288.78 9998.46 0.771
Day 0.97 0.91 1.04 1.000 20771.69 8890.89 0.785
Daily weartime 1.00* 1.00 1.00 1.000 12258.92 8147.17 1
Between-Person Effects
Mean persuasion experienced 1.10 0.82 1.46 1.003 1635.21 3066.39 0.748
Mean persuasion utilized (partner’s view) 0.98 0.73 1.30 1.003 1664.34 3415.83 0.559
Mean pressure experienced 0.98 0.73 1.31 1.003 2233.86 4590.15 0.56
Mean pressure utilized (partner’s view) 0.97 0.73 1.28 1.002 2141.33 4170.53 0.594
Mean pushing experienced 0.97 0.65 1.45 1.002 2615.53 4583.92 0.553
Mean pushing utilized (partner’s view) 1.25 0.83 1.85 1.002 2546.44 4664.09 0.859
Mean weartime 1.00 1.00 1.00 1.000 16930.39 10509.93 0.909
Random Effects
sd(Intercept) 0.31 0.24 0.40 1.00 2373.00 4540.45 NA
sd(Daily persuasion experienced) 0.05 0.02 0.08 1.00 6108.14 4438.88 NA
sd(Daily persuasion utilized (partner’s view)) 0.06 0.03 0.09 1.00 6116.29 5901.98 NA
sd(Daily pressure experienced) 0.05 0.00 0.14 1.00 5104.76 5590.89 NA
sd(Daily pressure utilized (partner’s view)) 0.04 0.00 0.12 1.00 6898.74 5731.73 NA
sd(Daily pushing experienced) 0.07 0.01 0.15 1.00 2745.29 3354.31 NA
sd(Daily pushing utilized (partner’s view)) 0.04 0.00 0.10 1.00 4176.37 5266.68 NA
Additional Parameters
ar[1] NA NA NA NA NA NA NA
ma[1] NA NA NA NA NA NA NA
cosy NA NA NA NA NA NA NA
nu NA NA NA NA NA NA NA
shape NA NA NA NA NA NA NA
sderr NA NA NA NA NA NA NA
sigma 0.57 0.56 0.59 1.00 19512.21 8255.47 NA

Affect

range(df_double$aff, na.rm = T) 
## [1] 0 5
hist(df_double$aff, breaks = 15)

Gaussian

formula <- bf(
  aff ~ 
    persuasion_self_cw + persuasion_partner_cw +
    pressure_self_cw + pressure_partner_cw +
    pushing_self_cw + pushing_partner_cw +
    
    persuasion_self_cb + persuasion_partner_cb +
    pressure_self_cb + pressure_partner_cb +
    pushing_self_cb + pushing_partner_cb +
    
    day +
    
    # Random effects
    (persuasion_self_cw + persuasion_partner_cw +
    pressure_self_cw + pressure_partner_cw +
    pushing_self_cw + pushing_partner_cw | coupleID)
  #, autocor = autocor_str
)


prior1 <- c(
  brms::set_prior("normal(0, 5)", class = "b")
  ,brms::set_prior("normal(0, 20)", class = "Intercept", lb=1, ub=6) # range of the outcome scale
  
  , brms::set_prior("normal(0, 2)", class = "sd", group = "coupleID", lb = 0)
  
  , brms::set_prior("cauchy(0, 2)", class = "sigma", lb = 0)
  #, brms::set_prior("cauchy(0, 2)", class = "sderr", lb = 0)
  
  #, autocor_prior
)

brms::validate_prior(
  prior1, 
  formula = formula, 
  data = df_double, 
  family = gaussian()
  )
## Warning: Rows containing NAs were excluded from the model.
#df_minimal <- df_double[, c("AorB", all.vars(as.formula(formula)))]

mood_gauss <- my_brm(
  mi = use_mi, 
  imputed_data = implist,
  
  formula = formula, 
  prior = prior1,
  data = df_double, 
  family = gaussian(),
  #control = list(adapt_delta = 0.95, max_treedepth = 15),
  iter = iterations,
  warmup = warmup,
  chains = 4,
  cores = 4,
  seed = 7777,
  file = file.path("models_cache_brms", paste0("mood_gauss_NOAR", suffix))
)
## Warning: Rows containing NAs were excluded from the model.
check_brms(mood_gauss, log_pp_check = FALSE)
## 
## Divergences:
## 0 of 12000 iterations ended with a divergence.
## 
## Tree depth:
## 0 of 12000 iterations saturated the maximum tree depth of 10.
## 
## Energy:
## E-BFMI indicated no pathological behavior.

## Using 10 posterior draws for ppc type 'ecdf_overlay' by default.

## Using 10 posterior draws for ppc type 'dens_overlay' by default.

## 
## Computed from 12000 by 3736 log-likelihood matrix.
## 
##          Estimate    SE
## elpd_loo  -5185.9  59.2
## p_loo        75.2   3.3
## looic     10371.7 118.5
## ------
## MCSE of elpd_loo is 0.1.
## MCSE and ESS estimates assume MCMC draws (r_eff in [0.5, 2.1]).
## 
## All Pareto k estimates are good (k < 0.7).
## See help('pareto-k-diagnostic') for details.
DHARMa.check_brms.all(mood_gauss, integer = FALSE)

## 
##  DHARMa outlier test based on exact binomial test with approximate
##  expectations
## 
## data:  model.check
## outliers at both margin(s) = 31, observations = 3736, p-value =
## 9.752e-11
## alternative hypothesis: true probability of success is not equal to 0.001998002
## 95 percent confidence interval:
##  0.00564461 0.01175733
## sample estimates:
## frequency of outliers (expected: 0.001998001998002 ) 
##                                          0.008297645
summarize_brms(
  mood_gauss, 
  model_rows_fixed = model_rows_fixed,
  model_rows_random = model_rows_random,
  model_rownames_fixed = model_rownames_fixed,
  model_rownames_random = model_rownames_random,
  exponentiate = F,
  include_p_direction = T) %>%
  print_df(rows_to_pack = rows_to_pack)
b l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS p_direction
Intercept 3.70* 3.48 3.91 1.007 1299.69 2626.71 1
Within-Person Effects
Daily persuasion experienced 0.00 -0.04 0.05 1.000 10096.58 8360.31 0.553
Daily persuasion utilized (partner’s view) 0.02 -0.02 0.07 1.001 8776.31 8901.48 0.829
Daily pressure experienced -0.04 -0.14 0.07 1.000 11418.22 8197.57 0.767
Daily pressure utilized (partner’s view) -0.02 -0.14 0.08 1.000 10703.53 8437.61 0.661
Daily pushing experienced 0.02 -0.04 0.09 1.000 11578.47 8985.61 0.768
Daily pushing utilized (partner’s view) 0.08* 0.01 0.14 1.000 10076.04 8287.53 0.984
Day 0.26* 0.15 0.37 1.001 17305.49 8858.10 1
Daily weartime NA NA NA NA NA NA NA
Between-Person Effects
Mean persuasion experienced 0.33 -0.21 0.90 1.003 1324.40 2167.41 0.889
Mean persuasion utilized (partner’s view) 0.22 -0.32 0.79 1.003 1322.88 2252.89 0.79
Mean pressure experienced -0.31 -0.86 0.23 1.003 1481.77 2769.72 0.874
Mean pressure utilized (partner’s view) -0.30 -0.84 0.24 1.003 1476.58 2758.08 0.871
Mean pushing experienced 0.22 -0.54 0.99 1.002 1997.17 3840.31 0.714
Mean pushing utilized (partner’s view) 0.35 -0.39 1.12 1.002 2005.43 3822.38 0.825
Mean weartime NA NA NA NA NA NA NA
Random Effects
sd(Intercept) 0.60 0.47 0.78 1.00 2148.52 4074.04 NA
sd(Daily persuasion experienced) 0.04 0.00 0.10 1.00 3348.96 5109.75 NA
sd(Daily persuasion utilized (partner’s view)) 0.08 0.01 0.13 1.00 3084.49 2127.56 NA
sd(Daily pressure experienced) 0.08 0.00 0.24 1.00 4964.63 5526.49 NA
sd(Daily pressure utilized (partner’s view)) 0.09 0.00 0.26 1.00 4911.35 5368.11 NA
sd(Daily pushing experienced) 0.06 0.00 0.14 1.00 3656.74 3408.48 NA
sd(Daily pushing utilized (partner’s view)) 0.07 0.00 0.17 1.00 4184.55 4073.31 NA
Additional Parameters
ar[1] NA NA NA NA NA NA NA
ma[1] NA NA NA NA NA NA NA
cosy NA NA NA NA NA NA NA
nu NA NA NA NA NA NA NA
shape NA NA NA NA NA NA NA
sderr NA NA NA NA NA NA NA
sigma 0.96 0.94 0.98 1.00 18080.51 9327.96 NA

Reactance

range(df_double$reactance, na.rm = T) 
## [1] 0 5
hist(df_double$reactance, breaks = 7) 

hist(log(df_double$reactance+0.1), breaks = 10)

Ordinal

df_double$reactance_ordinal <- factor(df_double$reactance,
                                      levels = 0:5, 
                                      ordered = TRUE)

formula <- bf(
  reactance_ordinal ~ 
    persuasion_self_cw + persuasion_partner_cw +
    pressure_self_cw + pressure_partner_cw +
    pushing_self_cw + pushing_partner_cw +
    
    persuasion_self_cb + persuasion_partner_cb +
    pressure_self_cb + pressure_partner_cb +
    pushing_self_cb + pushing_partner_cb +
    
    day +
    
    # Random effects
    (persuasion_self_cw + persuasion_partner_cw +
    pressure_self_cw + pressure_partner_cw +
    pushing_self_cw + pushing_partner_cw | coupleID)
  #, autocor = autocor_str
)


prior1 <- c(
  brms::set_prior("normal(0, 2.5)", class = "b")
  #, brms::set_prior("normal(0, 10)", class = "Intercept", lb=0, ub=5) # range of the outcome scale
  
  , brms::set_prior("normal(0, 2)", class = "sd", group = "coupleID", lb = 0)
  
  #, brms::set_prior("cauchy(0, 2)", class = "sigma", lb = 0)
  #, brms::set_prior("cauchy(0, 2)", class = "sderr", lb = 0)
  
  #, autocor_prior
)


brms::validate_prior(
  prior1, 
  formula = formula, 
  data = df_double, 
  family = cumulative() # HURDLE_CUMULATIVE
  )
## Warning: Rows containing NAs were excluded from the model.
#df_minimal <- df_double[, c("AorB", all.vars(as.formula(formula)))]

reactance_ordinal <- my_brm(
  mi = use_mi, 
  imputed_data = implist,
  
  formula = formula, 
  prior = prior1,
  data = df_double, 
  family = brms::cumulative(),
  #control = list(adapt_delta = 0.95),
  iter = iterations,
  warmup = warmup,
  chains = 4,
  cores = 4,
  seed = 7777
  #, file = file.path("models_cache_brms", paste0("reactance_ordinal_NOARNOAR_", suffix))
)
## Warning: Rows containing NAs were excluded from the model.
check_brms(reactance_ordinal)
## 
## Divergences:
## 0 of 12000 iterations ended with a divergence.
## 
## Tree depth:
## 0 of 12000 iterations saturated the maximum tree depth of 10.
## 
## Energy:
## E-BFMI indicated no pathological behavior.

## Using 10 posterior draws for ppc type 'ecdf_overlay' by default.

## Using 10 posterior draws for ppc type 'dens_overlay' by default.

## Warning: Found 6 observations with a pareto_k > 0.7 in model 'model'. We
## recommend to set 'moment_match = TRUE' in order to perform moment matching for
## problematic observations.
## 
## Computed from 12000 by 756 log-likelihood matrix.
## 
##          Estimate   SE
## elpd_loo   -681.9 31.9
## p_loo        73.4  5.4
## looic      1363.8 63.8
## ------
## MCSE of elpd_loo is NA.
## MCSE and ESS estimates assume MCMC draws (r_eff in [0.4, 1.7]).
## 
## Pareto k diagnostic values:
##                          Count Pct.    Min. ESS
## (-Inf, 0.7]   (good)     750   99.2%   445     
##    (0.7, 1]   (bad)        6    0.8%   <NA>    
##    (1, Inf)   (very bad)   0    0.0%   <NA>    
## See help('pareto-k-diagnostic') for details.
DHARMa.check_brms.all(reactance_ordinal, outliers_type = 'bootstrap')

## 
##  DHARMa bootstrapped outlier test
## 
## data:  model.check
## outliers at both margin(s) = 1, observations = 756, p-value = 0.4
## alternative hypothesis: two.sided
##  percent confidence interval:
##  0.000000000 0.002017196
## sample estimates:
## outlier frequency (expected: 0.000304232804232804 ) 
##                                         0.001322751
summarize_brms(
  reactance_ordinal, 
  model_rows_fixed = model_rows_fixed_ordinal,
  model_rows_random = model_rows_random_ordinal,
  model_rownames_fixed = model_rownames_fixed_ordinal,
  model_rownames_random = model_rownames_random_ordinal,
  exponentiate = T,
  include_p_direction = T) %>%
  print_df(rows_to_pack = rows_to_pack_ordinal)
OR l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS p_direction
Intercepts
Intercept NA NA NA NA NA NA NA
Intercept[1] 3.85* 2.33 6.45 1.000 8597.51 9211.52 1
Intercept[2] 8.35* 4.95 14.45 1.000 8834.13 8761.87 1
Intercept[3] 23.24* 13.13 42.31 1.000 9373.11 9135.25 1
Intercept[4] 101.58* 52.10 209.10 1.000 10595.59 9691.96 1
Intercept[5] 3488.39* 1077.21 13336.21 1.001 13289.90 8614.35 1
Within-Person Effects
Daily persuasion experienced 0.85* 0.71 0.99 1.000 9896.79 7775.98 0.98
Daily persuasion utilized (partner’s view) 1.03 0.84 1.24 1.000 9229.64 7954.31 0.607
Daily pressure experienced 1.84* 1.18 2.68 1.001 5608.70 6574.26 0.994
Daily pressure utilized (partner’s view) 1.22 0.71 2.06 1.001 7420.47 6712.38 0.808
Daily pushing experienced 1.17 0.97 1.43 1.001 7757.54 7485.59 0.946
Daily pushing utilized (partner’s view) 0.91 0.71 1.17 1.000 9792.98 8248.45 0.77
Day 1.47 0.75 2.89 1.000 13856.59 9556.08 0.871
Daily weartime NA NA NA NA NA NA NA
Between-Person Effects
Mean persuasion experienced 1.12 0.40 3.11 1.000 4004.78 6205.61 0.586
Mean persuasion utilized (partner’s view) 1.38 0.45 4.31 1.000 4278.63 6604.64 0.711
Mean pressure experienced 3.51* 1.18 10.71 1.000 4792.44 6629.78 0.99
Mean pressure utilized (partner’s view) 1.17 0.37 3.66 1.000 4762.77 6973.89 0.612
Mean pushing experienced 1.23 0.28 5.62 1.000 5266.91 7722.24 0.605
Mean pushing utilized (partner’s view) 0.11* 0.02 0.64 1.000 7169.66 7894.75 0.992
Mean weartime NA NA NA NA NA NA NA
Random Effects
sd(Intercept) 0.82 0.47 1.25 1.00 4256.66 7026.55 NA
sd(Daily persuasion experienced) 0.18 0.01 0.43 1.00 1818.16 4469.30 NA
sd(Daily persuasion utilized (partner’s view)) 0.22 0.01 0.51 1.00 3273.96 4646.21 NA
sd(Daily pressure experienced) 0.56 0.09 1.14 1.00 2689.26 2386.75 NA
sd(Daily pressure utilized (partner’s view)) 0.50 0.02 1.55 1.00 2929.20 4951.16 NA
sd(Daily pushing experienced) 0.22 0.01 0.50 1.00 3370.38 4130.06 NA
sd(Daily pushing utilized (partner’s view)) 0.18 0.01 0.57 1.00 4830.97 5284.06 NA
Additional Parameters
ar[1] NA NA NA NA NA NA NA
ma[1] NA NA NA NA NA NA NA
cosy NA NA NA NA NA NA NA
nu NA NA NA NA NA NA NA
shape NA NA NA NA NA NA NA
sderr NA NA NA NA NA NA NA
sigma NA NA NA NA NA NA NA
disc 1.00 1.00 1.00 NA NA NA NA
hypothesis(reactance_ordinal, "pressure_self_cw > pushing_self_cw")
## Hypothesis Tests for class b:
##                 Hypothesis Estimate Est.Error CI.Lower CI.Upper Evid.Ratio
## 1 (pressure_self_cw... > 0     0.46      0.24     0.03     0.84      24.42
##   Post.Prob Star
## 1      0.96    *
## ---
## 'CI': 90%-CI for one-sided and 95%-CI for two-sided hypotheses.
## '*': For one-sided hypotheses, the posterior probability exceeds 95%;
## for two-sided hypotheses, the value tested against lies outside the 95%-CI.
## Posterior probabilities of point hypotheses assume equal prior probabilities.

Binary

introduce_binary_reactance <- function(data) {
  data$is_reactance <- factor(data$reactance > 0, levels = c(FALSE, TRUE), labels = c(0, 1))
  return(data)
}



df_double <- introduce_binary_reactance(df_double)
if (use_mi) {
  for (i in seq_along(implist)) {
    implist[[i]] <- introduce_binary_reactance(implist[[i]])
  }
}


formula <- bf(
  is_reactance ~ 
    persuasion_self_cw + persuasion_partner_cw +
    pressure_self_cw + pressure_partner_cw +
    pushing_self_cw + pushing_partner_cw +
    
    persuasion_self_cb + persuasion_partner_cb +
    pressure_self_cb + pressure_partner_cb +
    pushing_self_cb + pushing_partner_cb +
    
    day +
    
    # Random effects
    (persuasion_self_cw + persuasion_partner_cw +
    pressure_self_cw + pressure_partner_cw +
    pushing_self_cw + pushing_partner_cw | coupleID)
  #, autocor = autocor_str
  )



prior1 <- c(
  brms::set_prior("normal(0, 2.5)", class = "b")
  , brms::set_prior("normal(0, 10)", class = "Intercept", lb=0, ub=5) # range of the outcome scale
  
  , brms::set_prior("normal(0, 2)", class = "sd", group = "coupleID", lb = 0)
  
  #, brms::set_prior("cauchy(0, 2)", class = "sigma", lb = 0)
  #, brms::set_prior("cauchy(0, 2)", class = "sderr", lb = 0)
  
  #, autocor_prior
)


brms::validate_prior(
  prior1, 
  formula = formula, 
  data = df_double, 
  family = bernoulli()
  )
## Warning: Rows containing NAs were excluded from the model.
#df_minimal <- df_double[, c("AorB", all.vars(as.formula(formula)))]

is_reactance <- my_brm(
  mi = use_mi, 
  imputed_data = implist,
  
  formula = formula, 
  prior = prior1,
  data = df_double, 
  family = brms::bernoulli(),
  #control = list(adapt_delta = 0.95, max_treedepth = 15),
  iter = iterations,
  warmup = warmup,
  chains = 4,
  cores = 4,
  seed = 7777,
  file = file.path("models_cache_brms", paste0("is_reactance_NOARNOAR_", suffix))
  #, file_refit = 'always'
)
## Warning: Rows containing NAs were excluded from the model.
check_brms(is_reactance)
## 
## Divergences:
## 0 of 12000 iterations ended with a divergence.
## 
## Tree depth:
## 0 of 12000 iterations saturated the maximum tree depth of 10.
## 
## Energy:
## E-BFMI indicated no pathological behavior.

## Using 10 posterior draws for ppc type 'ecdf_overlay' by default.

## Using 10 posterior draws for ppc type 'dens_overlay' by default.

## Warning: Found 55 observations with a pareto_k > 0.7 in model 'model'. We
## recommend to set 'moment_match = TRUE' in order to perform moment matching for
## problematic observations.
## 
## Computed from 12000 by 756 log-likelihood matrix.
## 
##          Estimate   SE
## elpd_loo   -363.1 16.0
## p_loo        80.1  6.0
## looic       726.3 32.0
## ------
## MCSE of elpd_loo is NA.
## MCSE and ESS estimates assume MCMC draws (r_eff in [0.4, 1.5]).
## 
## Pareto k diagnostic values:
##                          Count Pct.    Min. ESS
## (-Inf, 0.7]   (good)     701   92.7%   429     
##    (0.7, 1]   (bad)       49    6.5%   <NA>    
##    (1, Inf)   (very bad)   6    0.8%   <NA>    
## See help('pareto-k-diagnostic') for details.
DHARMa.check_brms.all(is_reactance, integer = FALSE)

## 
##  DHARMa outlier test based on exact binomial test with approximate
##  expectations
## 
## data:  model.check
## outliers at both margin(s) = 1, observations = 756, p-value = 1
## alternative hypothesis: true probability of success is not equal to 0.001998002
## 95 percent confidence interval:
##  0.0000334886 0.0073476538
## sample estimates:
## frequency of outliers (expected: 0.001998001998002 ) 
##                                          0.001322751
summarize_brms(
  is_reactance, 
  model_rows_fixed = model_rows_fixed,
  model_rows_random = model_rows_random,
  model_rownames_fixed = model_rownames_fixed,
  model_rownames_random = model_rownames_random,
  exponentiate = T,
  include_p_direction = T) %>%
  print_df(rows_to_pack = rows_to_pack)
OR l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS p_direction
Intercept 0.29* 0.16 0.50 1.000 13412.80 10197.69 1
Within-Person Effects
Daily persuasion experienced 0.84 0.69 1.01 1.001 12653.33 8961.78 0.966
Daily persuasion utilized (partner’s view) 1.13 0.85 1.54 1.000 9878.26 8807.43 0.789
Daily pressure experienced 2.04* 1.03 4.57 1.000 8289.60 6530.31 0.979
Daily pressure utilized (partner’s view) 1.44 0.58 4.04 1.000 8810.48 6987.21 0.799
Daily pushing experienced 1.28* 1.01 1.64 1.001 12865.46 8547.86 0.979
Daily pushing utilized (partner’s view) 0.89 0.60 1.31 1.000 14162.09 8870.67 0.735
Day 1.64 0.77 3.51 1.000 19648.18 9310.83 0.9
Daily weartime NA NA NA NA NA NA NA
Between-Person Effects
Mean persuasion experienced 1.99 0.60 6.80 1.000 6422.05 7842.49 0.87
Mean persuasion utilized (partner’s view) 1.90 0.52 7.15 1.000 6799.76 8735.29 0.829
Mean pressure experienced 17.91* 2.33 159.59 1.000 8975.03 8541.37 0.997
Mean pressure utilized (partner’s view) 2.27 0.24 19.14 1.000 8119.78 8948.63 0.769
Mean pushing experienced 0.83 0.12 6.30 1.000 8730.85 8605.26 0.58
Mean pushing utilized (partner’s view) 0.08* 0.01 0.66 1.000 10022.27 10004.57 0.99
Mean weartime NA NA NA NA NA NA NA
Random Effects
sd(Intercept) 1.18 0.75 1.74 1.00 5382.54 7890.40 NA
sd(Daily persuasion experienced) 0.21 0.01 0.51 1.00 2939.60 5289.74 NA
sd(Daily persuasion utilized (partner’s view)) 0.50 0.12 0.97 1.00 4502.23 4854.72 NA
sd(Daily pressure experienced) 1.12 0.16 2.43 1.00 2982.38 3385.24 NA
sd(Daily pressure utilized (partner’s view)) 0.97 0.04 2.73 1.00 4249.53 5650.95 NA
sd(Daily pushing experienced) 0.25 0.01 0.60 1.00 4754.94 5282.30 NA
sd(Daily pushing utilized (partner’s view)) 0.31 0.01 0.95 1.00 4810.38 6592.98 NA
Additional Parameters
ar[1] NA NA NA NA NA NA NA
ma[1] NA NA NA NA NA NA NA
cosy NA NA NA NA NA NA NA
nu NA NA NA NA NA NA NA
shape NA NA NA NA NA NA NA
sderr NA NA NA NA NA NA NA
sigma NA NA NA NA NA NA NA
hypothesis(is_reactance, "pressure_self_cw > pushing_self_cw")
## Hypothesis Tests for class b:
##                 Hypothesis Estimate Est.Error CI.Lower CI.Upper Evid.Ratio
## 1 (pressure_self_cw... > 0     0.47      0.39    -0.15     1.13       8.86
##   Post.Prob Star
## 1       0.9     
## ---
## 'CI': 90%-CI for one-sided and 95%-CI for two-sided hypotheses.
## '*': For one-sided hypotheses, the posterior probability exceeds 95%;
## for two-sided hypotheses, the value tested against lies outside the 95%-CI.
## Posterior probabilities of point hypotheses assume equal prior probabilities.

Report All Models

if (report_ordinal) {
  model_rows_random_final <- model_rows_random_ordinal
  model_rows_fixed_final <- model_rows_fixed_ordinal
  model_rownames_fixed_final <- model_rownames_fixed_ordinal
  model_rownames_random_final <- model_rownames_random_ordinal
  rows_to_pack_final <- rows_to_pack_ordinal
} else {
  model_rows_random_final <- model_rows_random_hu
  model_rows_fixed_final <- model_rows_fixed_hu
  model_rownames_fixed_final <- model_rownames_fixed_hu
  model_rownames_random_final <- model_rownames_random_hu
  rows_to_pack_final <- rows_to_pack_hu
}



all_models <- report_side_by_side(
  pa_sub,
  pa_obj_log,
  mood_gauss,
  reactance_ordinal,
  is_reactance,
  
  model_rows_random = model_rows_random_final,
  model_rows_fixed = model_rows_fixed_final,
  model_rownames_random = model_rownames_random_final,
  model_rownames_fixed = model_rownames_fixed_final
) 
## [1] "pa_sub"
## Warning in summarize_brms(model, short_version = TRUE, exponentiate =
## exponentiate, : Coefficients were exponentiated. Double check if this was
## intended.
## [1] "pa_obj_log"
## Warning in summarize_brms(model, short_version = TRUE, exponentiate =
## exponentiate, : Coefficients were exponentiated. Double check if this was
## intended.
## [1] "mood_gauss"
## [1] "reactance_ordinal"
## [1] "is_reactance"
# pretty printing
summary_all_models <- all_models %>%
  print_df(rows_to_pack = rows_to_pack_final) %>%
  add_header_above(
    c(" ", "Subjective MVPA Hurdle Poisson" = 2, 
      "Device-Based MVPA Log (Gaussian)" = 2, 
      "Mood Gaussian" = 2,
      "Reactance Ordinal" = 2,
      "Reactance Dichotome" = 2)
  )

export_xlsx(
  summary_all_models, 
  rows_to_pack = rows_to_pack_final,
  file.path("Output", "AllModels_experimental_noAR.xlsx"), 
  merge_option = 'both', 
  simplify_2nd_row = TRUE,
  colwidths = c(38, 7.2, 13.3, 7.2, 13.3,7.2, 13.3,7.2, 13.3,7.2, 13.3),
  line_above_rows = c(1,2),
  line_below_rows = c(-1)
)
## 
## Attaching package: 'rvest'
## The following object is masked from 'package:readr':
## 
##     guess_encoding
summary_all_models
Subjective MVPA Hurdle Poisson
Device-Based MVPA Log (Gaussian)
Mood Gaussian
Reactance Ordinal
Reactance Dichotome
exp(Est.) pa_sub 95% CI pa_sub exp(Est.) pa_obj_log 95% CI pa_obj_log b mood_gauss 95% CI mood_gauss OR reactance_ordinal 95% CI reactance_ordinal OR is_reactance 95% CI is_reactance
Intercept 62.20* [55.66, 69.71] 117.41* [105.48, 130.41] 3.70* [ 3.48, 3.91] NA NA 0.29* [0.16, 0.50]
Hurdle Intercept 1.20 [ 0.86, 1.66] NA NA NA NA NA NA NA NA
Conditional Within-Person Effects
Daily persuasion experienced 0.98 [ 0.90, 1.07] 1.03 [ 1.00, 1.06] 0.00 [-0.04, 0.05] 0.85* [0.71, 0.99] 0.84 [0.69, 1.01]
Daily persuasion utilized (partner’s view) 1.03 [ 0.97, 1.11] 1.02 [ 0.99, 1.05] 0.02 [-0.02, 0.07] 1.03 [0.84, 1.24] 1.13 [0.85, 1.54]
Daily pressure experienced 7.90 [ 0.86, 70.81] 0.94 [ 0.88, 1.01] -0.04 [-0.14, 0.07] 1.84* [1.18, 2.68] 2.04* [1.03, 4.57]
Daily pressure utilized (partner’s view) 0.87 [ 0.71, 1.06] 0.98 [ 0.92, 1.05] -0.02 [-0.14, 0.08] 1.22 [0.71, 2.06] 1.44 [0.58, 4.04]
Daily pushing experienced 1.05 [ 0.87, 1.26] 1.03 [ 0.98, 1.08] 0.02 [-0.04, 0.09] 1.17 [0.97, 1.43] 1.28* [1.01, 1.64]
Daily pushing utilized (partner’s view) 0.94 [ 0.84, 1.04] 1.02 [ 0.97, 1.06] 0.08* [ 0.01, 0.14] 0.91 [0.71, 1.17] 0.89 [0.60, 1.31]
Day 0.92* [ 0.90, 0.95] 0.97 [ 0.91, 1.04] 0.26* [ 0.15, 0.37] 1.47 [0.75, 2.89] 1.64 [0.77, 3.51]
Daily weartime NA NA 1.00* [ 1.00, 1.00] NA NA NA NA NA NA
Conditional Between-Person Effects
Mean persuasion experienced 1.25 [ 0.94, 1.67] 1.10 [ 0.82, 1.46] 0.33 [-0.21, 0.90] 1.12 [0.40, 3.11] 1.99 [0.60, 6.80]
Mean persuasion utilized (partner’s view) 1.01 [ 0.75, 1.34] 0.98 [ 0.73, 1.30] 0.22 [-0.32, 0.79] 1.38 [0.45, 4.31] 1.90 [0.52, 7.15]
Mean pressure experienced 1.04 [ 0.78, 1.40] 0.98 [ 0.73, 1.31] -0.31 [-0.86, 0.23] 3.51* [1.18, 10.71] 17.91* [2.33, 159.59]
Mean pressure utilized (partner’s view) 0.75 [ 0.56, 1.00] 0.97 [ 0.73, 1.28] -0.30 [-0.84, 0.24] 1.17 [0.37, 3.66] 2.27 [0.24, 19.14]
Mean pushing experienced 1.13 [ 0.75, 1.72] 0.97 [ 0.65, 1.45] 0.22 [-0.54, 0.99] 1.23 [0.28, 5.62] 0.83 [0.12, 6.30]
Mean pushing utilized (partner’s view) 1.20 [ 0.79, 1.81] 1.25 [ 0.83, 1.85] 0.35 [-0.39, 1.12] 0.11* [0.02, 0.64] 0.08* [0.01, 0.66]
Mean weartime NA NA 1.00 [ 1.00, 1.00] NA NA NA NA NA NA
Hurdle Within-Person Effects
Hu Daily persuasion experienced 0.65* [ 0.57, 0.73] NA NA NA NA NA NA NA NA
Hu Daily persuasion utilized (partner’s view) 0.75* [ 0.67, 0.84] NA NA NA NA NA NA NA NA
Hu Daily pressure experienced 1.23 [ 0.88, 1.74] NA NA NA NA NA NA NA NA
Hu Daily pressure utilized (partner’s view) 0.66* [ 0.42, 0.95] NA NA NA NA NA NA NA NA
Hu Daily pushing experienced 0.58* [ 0.40, 0.79] NA NA NA NA NA NA NA NA
Hu Daily pushing utilized (partner’s view) 0.54* [ 0.41, 0.68] NA NA NA NA NA NA NA NA
Hu Day 1.09 [ 0.84, 1.42] NA NA NA NA NA NA NA NA
Hu Daily weartime NA NA NA NA NA NA NA NA NA NA
Hurdle Between-Person Effects
Hu Mean persuasion experienced 0.83 [ 0.36, 1.94] NA NA NA NA NA NA NA NA
Hu Mean persuasion utilized (partner’s view) 0.83 [ 0.36, 1.95] NA NA NA NA NA NA NA NA
Hu Mean pressure experienced 3.48* [ 1.39, 8.81] NA NA NA NA NA NA NA NA
Hu Mean pressure utilized (partner’s view) 1.83 [ 0.74, 4.54] NA NA NA NA NA NA NA NA
Hu Mean pushing experienced 0.32 [ 0.10, 1.05] NA NA NA NA NA NA NA NA
Hu Mean pushing utilized (partner’s view) 0.31 [ 0.09, 1.03] NA NA NA NA NA NA NA NA
Hu Mean weartime NA NA NA NA NA NA NA NA NA NA
Random Effects
sd(Intercept) 0.35 [0.27, 0.45] 0.31 [0.24, 0.40] 0.60 [0.47, 0.78] 0.82 [0.47, 1.25] 1.18 [0.75, 1.74]
sd(Hurdle Intercept) 0.90 [0.69, 1.18] NA NA NA NA NA NA NA NA
sd(Daily persuasion experienced) 0.25 [0.20, 0.32] 0.05 [0.02, 0.08] 0.04 [0.00, 0.10] 0.18 [0.01, 0.43] 0.21 [0.01, 0.51]
sd(Daily persuasion utilized (partner’s view)) 0.19 [0.15, 0.25] 0.06 [0.03, 0.09] 0.08 [0.01, 0.13] 0.22 [0.01, 0.51] 0.50 [0.12, 0.97]
sd(Daily pressure experienced) 6.39 [5.07, 8.02] 0.05 [0.00, 0.14] 0.08 [0.00, 0.24] 0.56 [0.09, 1.14] 1.12 [0.16, 2.43]
sd(Daily pressure utilized (partner’s view)) 0.49 [0.34, 0.71] 0.04 [0.00, 0.12] 0.09 [0.00, 0.26] 0.50 [0.02, 1.55] 0.97 [0.04, 2.73]
sd(Daily pushing experienced) 0.52 [0.33, 0.76] 0.07 [0.01, 0.15] 0.06 [0.00, 0.14] 0.22 [0.01, 0.50] 0.25 [0.01, 0.60]
sd(Daily pushing utilized (partner’s view)) 0.31 [0.23, 0.40] 0.04 [0.00, 0.10] 0.07 [0.00, 0.17] 0.18 [0.01, 0.57] 0.31 [0.01, 0.95]
sd(Hu Daily persuasion experienced) 0.18 [0.03, 0.34] NA NA NA NA NA NA NA NA
sd(Hu Daily persuasion utilized (partner’s view)) 0.17 [0.02, 0.33] NA NA NA NA NA NA NA NA
sd(Hu Daily pressure experienced) 0.30 [0.01, 0.85] NA NA NA NA NA NA NA NA
sd(Hu Daily pressure utilized (partner’s view)) 0.35 [0.01, 1.03] NA NA NA NA NA NA NA NA
sd(Hu Daily pushing experienced) 0.65 [0.33, 1.10] NA NA NA NA NA NA NA NA
sd(Hu Daily pushing utilized (partner’s view)) 0.32 [0.05, 0.64] NA NA NA NA NA NA NA NA
Additional Parameters
ar[1] NA NA NA NA NA NA NA NA NA NA
ma[1] NA NA NA NA NA NA NA NA NA NA
cosy NA NA NA NA NA NA NA NA NA NA
nu NA NA NA NA NA NA NA NA NA NA
shape NA NA NA NA NA NA NA NA NA NA
sderr NA NA NA NA NA NA NA NA NA NA
sigma NA NA 0.57 [0.56, 0.59] 0.96 [0.94, 0.98] NA NA NA NA
report::report_system()

Analyses were conducted using the R Statistical language (version 4.4.1; R Core Team, 2024) on Windows 11 x64 (build 22635)

report::report_packages()
  • beepr (version 2.0; Bååth R, 2024)
  • R.methodsS3 (version 1.8.2; Bengtsson H, 2003)
  • R.oo (version 1.26.0; Bengtsson H, 2003)
  • R.utils (version 2.12.3; Bengtsson H, 2023)
  • brms (version 2.21.0; Bürkner P, 2017)
  • Rcpp (version 1.0.13; Eddelbuettel D et al., 2024)
  • bayesplot (version 1.11.1; Gabry J, Mahr T, 2024)
  • lubridate (version 1.9.3; Grolemund G, Wickham H, 2011)
  • DHARMa (version 0.4.6; Hartig F, 2022)
  • wbCorr (version 0.1.22; Küng P, 2023)
  • tibble (version 3.2.1; Müller K, Wickham H, 2023)
  • R (version 4.4.1; R Core Team, 2024)
  • openxlsx (version 4.2.7.1; Schauberger P, Walker A, 2024)
  • ggplot2 (version 3.5.1; Wickham H, 2016)
  • forcats (version 1.0.0; Wickham H, 2023)
  • stringr (version 1.5.1; Wickham H, 2023)
  • rvest (version 1.0.4; Wickham H, 2024)
  • tidyverse (version 2.0.0; Wickham H et al., 2019)
  • readxl (version 1.4.3; Wickham H, Bryan J, 2023)
  • dplyr (version 1.1.4; Wickham H et al., 2023)
  • purrr (version 1.0.2; Wickham H, Henry L, 2023)
  • readr (version 2.1.5; Wickham H et al., 2024)
  • xml2 (version 1.3.6; Wickham H et al., 2023)
  • tidyr (version 1.3.1; Wickham H et al., 2024)
  • knitr (version 1.48; Xie Y, 2024)
  • kableExtra (version 1.4.0; Zhu H, 2024)
report::cite_packages()